Issue diagnostic if we find dying domains on Xend restart, because we will not
authoremellor@ewan <emellor@ewan>
Thu, 6 Oct 2005 09:16:50 +0000 (10:16 +0100)
committeremellor@ewan <emellor@ewan>
Thu, 6 Oct 2005 09:16:50 +0000 (10:16 +0100)
be able to show them any longer, as the paths in the store have gone.  Don't
call cleanupVm when a domain dies, as localhost-migrating VMs will be blown
away by this (there is actually a race between the saving process and the
resuming process).  This fixes bug #276.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendDomain.py

index b109ef69f2b45076102d70c4c6d9686eb8b77cbb..39481573a0150d5f8b454ccf5ebd8947fd0d9d0e 100644 (file)
@@ -146,7 +146,6 @@ class XendDomain:
         if info:
             del self.domains[domid]
             info.cleanupDomain()
-            info.cleanupVm()
 
 
     def refresh(self):
@@ -161,25 +160,31 @@ class XendDomain:
             else:
                 self._delete_domain(d.getDomid())
         for d in doms:
-            if d not in self.domains and not doms[d]['dying']:
-                try:
-                    dominfo = XendDomainInfo.recreate(doms[d])
-                    self._add_domain(dominfo)
-                except:
-                    if d == PRIV_DOMAIN:
-                        log.exception(
-                            "Failed to recreate information for domain "
-                            "%d.  Doing nothing except crossing my "
-                            "fingers.", d)
-                    else:
-                        log.exception(
-                            "Failed to recreate information for domain "
-                            "%d.  Destroying it in the hope of "
-                            "recovery.", d)
-                        try:
-                            xc.domain_destroy(dom = d)
-                        except:
-                            log.exception('Destruction of %d failed.', d)
+            if d not in self.domains:
+                if doms[d]['dying']:
+                    log.error(
+                        'Cannot recreate information for dying domain %d.  '
+                        'Xend will ignore this domain from now on.',
+                        doms[d]['dom'])
+                else:
+                    try:
+                        dominfo = XendDomainInfo.recreate(doms[d])
+                        self._add_domain(dominfo)
+                    except:
+                        if d == PRIV_DOMAIN:
+                            log.exception(
+                                "Failed to recreate information for domain "
+                                "%d.  Doing nothing except crossing my "
+                                "fingers.", d)
+                        else:
+                            log.exception(
+                                "Failed to recreate information for domain "
+                                "%d.  Destroying it in the hope of "
+                                "recovery.", d)
+                            try:
+                                xc.domain_destroy(dom = d)
+                            except:
+                                log.exception('Destruction of %d failed.', d)
 
 
     ## public: